<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUserTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user', function (Blueprint $table) {
            $table->id();
            $table->string("username",30)->comment("用户名");
            $table->string("avatar",255)->nullable()->comment("头像");
            $table->string("password",50)->comment("密码");
            $table->string("salt",50)->comment("盐值");
            $table->string("phone",11)->nullable()->comment("手机号");
            $table->string("email",50)->nullable()->comment("邮箱");
            $table->tinyInteger("status")->default(1)->comment("状态:0 禁用 1启用");
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user');
    }
}
